package edu.hawaii.duedates.tests;

import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.Test;
import edu.hawaii.duedates.BorrowedItem;
import edu.hawaii.duedates.lenders.libraries.UhManoaLibraryQuery;

/**
 * Tests for UhManoaLibraryQuery.
 */
public class TestUhManoaLibraryQuery {

  /**
   * Tests for UhManoaLibraryQuery.
   */
  @Test
  public void testNormalOperation() {
    String id = System.getProperty("uhm.id");
    String lastName = System.getProperty("uhm.lastName");
    UhManoaLibraryQuery uhQuery = new UhManoaLibraryQuery(id, lastName);
    List<BorrowedItem> borrowedItems = uhQuery.getBorrowedItems();
    
    if (uhQuery.isValid()) {
      assertEquals("Same number of items", borrowedItems.size(), 5);
      System.out.println(borrowedItems.get(0));
    }
  }
}
